CSS Master by Brown Tiffany B

CSS Master by Brown Tiffany B

Author:Brown, Tiffany B
Language: eng
Format: epub
Publisher: SitePoint
Published: 2015-09-21T16:00:00+00:00


Note: Lacking confidence with JavaScript?

If any of that went over your head, don’t worry. Web Platform Docs explains these concepts in its guide to programming basics, or pick up Darren Jones’ JavaScript: Novice to Ninja. Using jQuery? Try the jQuery Learning Center.

Now let’s look at our CSS. It’s only a few lines long:

body { background: #fcf; transition: 5s; } .change { background: #0cf; }

Here we’ve defined a starting background color for our body element, and a transition. We’ve also defined a .change class, which has a different value for background. When our event handler runs, it will add the change class to our body element. This will trigger a transition from the original background color to the one defined in the .change declaration block, as shown in Figure 5.3.

If you want a transition to work in both directions—for example, when the class is both added and removed—you should add it to whichever declaration block is your start state. We’ve done that here by including the transition property in the body declaration block. If we moved the transition to the change class, our transition would only work when change was added to our body element, but not when it was removed.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Deep Learning with Python by François Chollet(12615)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7799)
Grails in Action by Glen Smith Peter Ledbrook(7713)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6433)
Kotlin in Action by Dmitry Jemerov(5080)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3908)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3343)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(3097)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2885)
The Art Of Deception by Kevin Mitnick(2619)
Drugs Unlimited by Mike Power(2477)
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson(2414)
A Blueprint for Production-Ready Web Applications: Leverage industry best practices to create complete web apps with Python, TypeScript, and AWS by Dr. Philip Jones(2354)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
Writing for the Web: Creating Compelling Web Content Using Words, Pictures and Sound (Eva Spring's Library) by Lynda Felder(2273)
SEO 2018: Learn search engine optimization with smart internet marketing strategies by Adam Clarke(2199)
JavaScript by Example by S Dani Akash(2147)
DarkMarket by Misha Glenny(2091)
Wireless Hacking 101 by Karina Astudillo(2087)
Hands-On Cybersecurity with Blockchain by Rajneesh Gupta(2055)